#递归函数:函数在内部调用自身本身
def fact(n):
     if n==1:
        return 1
     return n*fact(n-1)
print(fact(5))
print(fact(7))

#汉塔诺
def move(n,a,b,c):#n个盘子从a移到c，b为辅助
    if n==1:
        print(a,'-->',c)
    else:
        move(n-1,a,c,b)#n-1个盘子从a移到b
        move(1,a,b,c)#1个盘子从a移到c
        move(n-1,b,a,c)#n-1个盘子从b移到c
print(move(4,"A","B","C"))
